package com.cz.zslu.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.cz.zslu.common.ReturnObject;
import com.cz.zslu.entity.BaseMenu;
import com.cz.zslu.interceptor.IgnoreAuth;
import com.cz.zslu.rest.BaseController;
import com.cz.zslu.service.IBaseMenuService;
import com.cz.zslu.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户菜单管理控制器
 * </p>
 *
 * @author Bruce
 * @since 2019-08-06
 */
@RestController
@RequestMapping("/sys/basemenu")
@Api(description = "用户菜管理")
public class BaseMenuController extends BaseController<IBaseMenuService, BaseMenu> {




    @ApiOperation("获取所有菜单")
    @RequestMapping(value = "/getAllPage", method = RequestMethod.POST)
    public ReturnObject<List<BaseMenu>> getAllNewPage() {

        EntityWrapper<BaseMenu> ew = new EntityWrapper<BaseMenu>();
        ew.eq("status", 0);
        ew.orderBy("crt_time", false);
       List<BaseMenu> list=baseService.selectList(new EntityWrapper<BaseMenu>().eq("status", 0).orderBy("crt_time", false));

        return new ReturnObject<>(0, "获取成功", list);
    }

}

